/**
 * Copyright (c) 2016-2019 优博信息科技 All rights reserved.
 *
 * https://www.jnyoubo.com
 *
 * 版权所有，侵权必究！
 */

package com.youbo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youbo.common.utils.HttpUtils;
import com.youbo.common.utils.JsonTools;
import com.youbo.config.UserConfig;
import com.youbo.dao.ApiV1Dao;
import com.youbo.entity.ApiV1Entity;
import com.youbo.entity.OrderMxEntity;
import com.youbo.form.*;
import com.youbo.service.ApiV1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("apiV1Service")
public class ApiV1ServiceImpl extends ServiceImpl<ApiV1Dao, ApiV1Entity> implements ApiV1Service {


	@Autowired
	private UserConfig userConfig;

	@Override
	public Integer clrOrderMx() {
		return baseMapper.clrOrderMx();
	}

	@Override
	public Long queryNextKey(String key, String tableName) {
		return baseMapper.queryNextKey(key,tableName);
	}

	@Override
	public String getPatientInfo(String medicalCardNumber) {
		HashMap map=new HashMap<>();
		map.put("medicalCardNumber",medicalCardNumber);
		return HttpUtils.post(userConfig.getServiceIp()+"/prefront/patient/getPatientInfo", JsonTools.obj2String(map));
	}

	@Override
	public List<Detail> queryWaitPay(Long brid) {
		return baseMapper.queryWaitPay(brid);
	}



	@Override
	public Integer importBrOrder(Long brId,Long orderId, String date) {
		return baseMapper.importBrOrder(brId,orderId,date);
	}


	@Override
	public List<Dept> queryDept() {
		return baseMapper.queryDept();
	}

	@Override
	public List<Dept2> todayRegisterGetDepts() {
		return baseMapper.todayRegisterGetDepts();
	}

	@Override
	public List<Doctor> queryDoctors(String ksdm) {
		return baseMapper.queryDoctors(ksdm);
	}


	@Override
	public List<Doctor2> todayRegisterGetDoctors(String ksdm, String week, String sdate, String edate, String pm) {
		return baseMapper.todayRegisterGetDoctors(ksdm,week,sdate,edate,pm);
	}




	@Override
	public Integer queryGhCsz() {
		return baseMapper.queryGhCsz();
	}
	@Override
	public Integer queryGhYz() {
		return baseMapper.queryGhYz();
	}

	@Override
	public Integer queryGhFp(String sfz) {
		return baseMapper.queryGhFp(sfz);
	}

	@Override
	public HashMap<String, Object> queryGhf(String ksdm, String week, String pm) {
		return baseMapper.queryGhf(ksdm,week,pm);
	}


	@Override
	public HashMap<String, Object> summary(String sdate, String edate) {
		return baseMapper.summary(sdate,edate);
	}

	@Override
	public List<HashMap<String,Object>> dailySummary(String sdate, String edate) {
		return baseMapper.dailySummary(sdate,edate);
	}

	@Override
	public List<HashMap<String, Object>> detail(String sdate, String edate) {
		return baseMapper.detail(sdate,edate);
	}

	@Override
	public HashMap<String, Object> reconciliation(String tradeNo) {
		return baseMapper.reconciliation(tradeNo);
	}


	@Override
	public List<HashMap<String, Object>> queryHospitalizationRecord(String sfzh, String sdate, String edate) {
		return baseMapper.queryHospitalizationRecord(sfzh,sdate,edate);
	}

	@Override
	public HashMap<String, Object> queryHospitalization(String zyh) {
		return baseMapper.queryHospitalization(zyh);
	}

	@Override
	public List<HashMap<String, Object>> queryHospitalizationDetail(String zyh) {
		return baseMapper.queryHospitalizationDetail(zyh);
	}

	@Override
	public List<Detail> queryOrderMxByBrid(String brid,String orderId) {
		return baseMapper.queryOrderMxByBrid(brid,orderId);
	}


	@Override
	public HashMap<String, Object> statistics(String date1, String date2) {
		return baseMapper.statistics(date1,date2);
	}
}
